/*
 * @file    :task_system.h
 * @author  :LingFengLu
 * @date    :2023-06-08
 */

#ifndef _TASK_SYSTEM_H_
#define _TASK_SYSTEM_H_
#include "global.h"
#include "devos.h"
//Constant definition    宏定义
#define DEVICE_ID_SIZE		6

//Type definition    类型定义

typedef enum
{
	DEVICE_ENDIAN_LITTLE = 0,
	DEVICE_ENDIAN_BIG,
	DEVICE_COUNT_ENDIAN
} device_endian;

typedef enum
{
	DEVICE_TYPE_OTHER = 0,
	DEVICE_TYPE_METER,
	DEVICE_TYPE_PUMP,
	DEVICE_COUNT_TYPE
} device_type;

typedef struct
{
	uint8 u8_ID[DEVICE_ID_SIZE];
	uint8 u8_Endian;
	uint8 u8_Type;
	uint32 u32_Model;
	uint32 u32_Version;
	uint32 u32_Capacity;
} device;

typedef enum
{
	TASK_SYSTEM_PARAM_DEVICE = 0,
	TASK_SYSTEM_PARAM_BUSY,
	TASK_SYSTEM_PARAM_MEMORY,
	TASK_SYSTEM_COUNT_PARAM
} task_system_parameter;

//Function declaration    函数申明
void TaskSystem_Init
(
	devos_task_handle t_TaskHandle
);
void TaskSystem_Process
(
	devos_task_handle t_TaskHandle
);
uint TaskSystem_SetConfig
(
	uint ui_Parameter,
	const uint8 *u8p_Value,
	uint ui_Length
);
uint TaskSystem_GetConfig
(
	uint ui_Parameter,
	uint8 *u8p_Value,
	uint *uip_Length
);
//Golbal variable declaration   全局变量申明










#endif

